<?php
/**
 * Created by PhpStorm.
 * User: yuanjie
 * Date: 15/12/1
 * Time: 上午11:04
 */
class MaintenancePads extends Eloquent
{
    protected $table = "maintenance_pads";

  /**
   * @Author:      lyt
   * @DateTime:    2016-04-26 11:49:39
   * @Description: 查看 该pad 是否空闲  是否有用户登录 如果有返回 false 如果没有返回 true
   */
  public static function isFree($id){
    $mp=MaintenancePads::find($id);
    $et=EngineerTokens::where("work_station_num",$mp->work_station_num)->first();
    return !isset($et);
  } 
}
